package cur.nature.starter.common.idgenerator.mirco;

import cur.nature.framework.mvc.crud.CrudDao;
import cur.nature.tinyorm.core.template.DefaultJdbcTemplate;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 用户信息 Dao
 * 作者：Auto Generator By wujian
 * 生成日期：2023-07-10 21:42:14
 */
@Component
@DependsOn(DefaultJdbcTemplate.TEMPLATE)
public class MircoServerDao extends CrudDao<Admin_MircoServerPO, Admin_MircoServerVO> {

    public MircoServerDao(@Qualifier(DefaultJdbcTemplate.TEMPLATE) DefaultJdbcTemplate template) {
        super(Admin_MircoServerPO.class, Admin_MircoServerVO.class, template);
    }

    public List<Admin_MircoServerVO> query(final Admin_MircoServerVO.query_Param param) throws Exception {
        // condition
        StringBuilder condition = new StringBuilder();
        condition.append(" and server_name ='").append(param.getServerName()).append("' ");
        if(param.getServerSeq() != null) {
            condition.append(" and server_seq =").append(param.getServerSeq());
        }
        // query
        return queryByCond(condition.toString());
    }

    public String getTableName() {
        return tableName();
    }




}

